# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/pd/pd-0.38.4.ebuild,v 1.3 2005/11/02 18:14:30 gustavoz Exp $

IUSE="X alsa debug jack"

inherit eutils

DESCRIPTION="Pure Data Packet (PDP) is an extension library for Pd to provide a way to use arbitrary data types (data packets) as messages that can be passed around inside Pd."
HOMEPAGE="http://zwizwa.fartit.com/pd/pdp/overview.html"
SRC_URI="http://zwizwa.fartit.com/pd/pdp/${P}.tar.gz"
LICENSE="|| ( BSD as-is )"
SLOT="0"
KEYWORDS="~amd64 ~ppc sparc x86"

DEPEND="media-sound/pd
	alsa? ( >=media-libs/alsa-lib-0.9.0_rc2 )
	jack? ( >=media-sound/jack-audio-connection-kit-0.99.0-r1 )
	X? ( virtual/x11 )"

src_unpack() {

	unpack ${A}
}

src_compile() {
	local myconf

	# --enable-alsa is bork
	if ! use alsa; then
		myconf="${myconf} --disable-alsa"
	fi

	econf \
		${myconf} \
		$(use_with X x) \
		$(use_enable jack) \
		$(use_enable debug) \
		|| die "./configure failed"
	emake || die "parallel make failed"
}

src_install() {
	make DESTDIR=${D} install || die "install failed"
}
